/*
 *英才会硕信息科技有限公司拥有本软件的版权，拥有本软件版权2025   并保留所有权利。
 *Copyright 2021,YCHS Information&Science Technology Co.,Ltd,
 *All rights reserved.
 */
package com.ychs.lawyerback01.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.ychs.lawyerback01.common.R;
import com.ychs.lawyerback01.dto.LoginReqDTO;
import com.ychs.lawyerback01.service.UserService;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.io.Console;
import java.util.Map;

/**
 * @author xuehongjin
 * @version 1.0
 * @date 2025/8/7
 */
@RestController
public class LoginController {
    @Autowired
    private UserService userService;
    @PostMapping("/login")
    public R<?> login(@Valid @RequestBody LoginReqDTO loginReqDTO) throws JsonProcessingException {
        Map<String, Object> map = userService.login(loginReqDTO);
        return R.success(map);

    }
}
